Skip to content

changed office hours banner to use ical#1221

Merged
CallumWalley merged 2 commits intomainfrom
calendar-smellendar
Apr 8, 2026
Merged

changed office hours banner to use ical#1221
CallumWalley merged 2 commits intomainfrom
calendar-smellendar

Conversation

@CallumWalley
Copy link
Copy Markdown
Member

. replace ms embed with table.… disable mkdocs2 warning

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Test deployment successful!! (2026-04-08T03:20:51Z)
Preview available at https://callumwalley.github.io/mkdocs-demo-deploy/nesi/support-docs/calendar-smellendar

Seems the following pages differ;



See all deployed demo sites

@CallumWalley
Copy link
Copy Markdown
Member Author

STRAIGHT TO PROD!

@CallumWalley CallumWalley merged commit ade467c into main Apr 8, 2026
8 checks passed
@CallumWalley CallumWalley deleted the calendar-smellendar branch April 8, 2026 03:20
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Avast! Ye've overhauled the office hours page by ditchin' the Google iframe for a dynamic ICAL-based table, while also battlin' the winds of change by pinnin' MkDocs and updatin' yer dependencies. But yer navigation is off, ye scallywag! Ye've loaded yer scripts in the wrong order in mkdocs.yml, leavin' general.js to search for ICAL in a fog. Furthermore, ye've got scripts firin' before the page is ready, a reliance on global variables that'll lead to mutiny, and a 'Add to Calendar' link so broken it couldn't find its way out of a bathtub. Even yer CSS is bloated with redundant padding. Clean up this mess or prepare to walk the plank!

- https://status.nesi.org.nz/embed/script.js
- assets/javascripts/mathjax.js
- https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
- https://cdnjs.cloudflare.com/ajax/libs/ical.js/1.3.0/ical.min.js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Arrr! Ye've put the cart before the horse, ye scurvy dog! Ye be callin' upon the ICAL spirits in general.js, but ye don't invite 'em onto the ship until the very end of the extra_javascript list. Swap the order so ical.min.js is aboard before general.js tries to use it, or yer banner will be lost in the fog!

return new Date(dateStringFormatted);
}

showOfficeBanner();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Arrr! Ye be firin' the cannons before the ship is even in the water! Callin' showOfficeBanner() immediately is risky business. Better to wait for the load event like ye did in the other scroll, or ye might find the ICAL library hasn't even boarded yet.

Suggested change
showOfficeBanner();
window.addEventListener("load", showOfficeBanner);

title: summary,
start,
description,
meetingLink: urlMatch ? urlMatch[1] : MEETING_LINK,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Ye be reachin' for MEETING_LINK like it's a bottle of rum that ain't even on yer ship! It's defined in general.js, but relyin' on global winds across different scrolls is a dangerous game. Define it here or pass it in properly, ye lazy deckhand.

<tr>
<td>${event.day}, ${event.date}</td>
<td>${event.time}</td>
<td><a href=" webcal://assets/training_calendar.ics" download class="md-button md-button--addcal"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80Zm-480-80q-33 0-56.5-23.5T120-240v-480q0-33 23.5-56.5T200-800h40v-80h80v80h240v-80h80v80h40q33 0 56.5 23.5T760-720v244q-20-3-40-3t-40 3v-84H200v320h280q0 20 3 40t11 40H200Zm0-480h480v-80H200v80Zm0 0v-80 80Z"/></svg>Add to Calendar</a></td>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Arrr! That link be a mess, ye barnacle-brained lubber! Ye've got a leadin' space, a webcal:// protocol with a relative path, and a download attribute all fightin' for control. If ye want 'em to download the scroll, use a proper path like /assets/training_calendar.ics. If ye want 'em to subscribe, ye need the full coordinates (URL). Fix it before the crew mutinies!

Suggested change
<td><a href=" webcal://assets/training_calendar.ics" download class="md-button md-button--addcal"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80Zm-480-80q-33 0-56.5-23.5T120-240v-480q0-33 23.5-56.5T200-800h40v-80h80v80h240v-80h80v80h40q33 0 56.5 23.5T760-720v244q-20-3-40-3t-40 3v-84H200v320h280q0 20 3 40t11 40H200Zm0-480h480v-80H200v80Zm0 0v-80 80Z"/></svg>Add to Calendar</a></td>
<td><a href="/assets/training_calendar.ics" download class="md-button md-button--addcal"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80Zm-480-80q-33 0-56.5-23.5T120-240v-480q0-33 23.5-56.5T200-800h40v-80h80v80h240v-80h80v80h40q33 0 56.5 23.5T760-720v244q-20-3-40-3t-40 3v-84H200v320h280q0 20 3 40t11 40H200Zm0-480h480v-80H200v80Zm0 0v-80 80Z"/></svg>Add to Calendar</a></td>

Comment on lines +2 to +5
padding: 0.1em;
margin: auto;
font-size: medium;
padding: 0.5em;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Ye be paintin' the hull twice! Why set the padding to 0.1em only to slap 0.5em over it a few lines later? It's a waste of good ink and makes ye look like a fresh-faced cabin boy. Clean up yer redundant styles!

Suggested change
padding: 0.1em;
margin: auto;
font-size: medium;
padding: 0.5em;
margin: auto;
font-size: medium;
padding: 0.5em;

@CallumWalley CallumWalley restored the calendar-smellendar branch April 8, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants